<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>留言|杨青个人博客网站</title>
<meta name="keywords" content="">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="./front/css/index.css" rel="stylesheet">
<link rel="stylesheet" href="./lib/layui/css/layui.css">
<script src="./front/js/jquery.min.js"></script>
<script src="./front/js/comm.js"></script>
<!-- <link href="./front/skin/html/css/index.css" rel="stylesheet">
<script src="./front/skin/html/js/jquery.min.js"></script> -->

<!--[if lt IE 9]>
<script src="/skin/html/js/modernizr.js"></script>
<![endif]-->
</head>
<body>
	<header>
		<div class="logo">杨青个人博客</div>
		<div class="top-nav">
			<h2 id="mnavh">
				<span class="navicon"></span>
			</h2>
			<ul id="nav">
				<li><a href="index">网站首页</a></li>
				<c:if test="${fenlei!=null}">
					<c:forEach items="${fenlei}" var="tion">
						<li><a href="main?cid=${tion.cid}">${tion.cName}</a></li>
					</c:forEach>
				</c:if>
				<li><a href="Aboutme">关于我</a></li>
				<li class="selected"><a href="Leaves">留言</a></li>
				<c:if test="${userz!=null}">
					<li><a href="indexs">${userz.userName}</a></li>
					<li><a href="tuichu">退出</a>
				</c:if>
				<c:if test="${userz==null}">
					<li><a href="login.html">登录</a></li>
				</c:if>
			</ul>
		</div>
	</header>
	<aside class="side">
		<div class="about">
			<i><a href="/"><img src="./front/skin/html/images/avatar.jpg"></a></i>
			<p>杨青，一个80后草根女站长！09年入行。一直潜心研究web前端技术，一边工作一边积累经验，分享一些个人博客模板，以及SEO优化等心得。</p>
		</div>
		<div class="weixin">
			<img src="http://www.yangqq.com/skin/html/images/wx.jpg">
			<p>关注我 么么哒！</p>
		</div>
	</aside>
	<main>
	<div class="main-content">
		<div class="welcome">您现在的位置是：首页>留言</div>
		<div class="blogbox">
			<c:if test="${content!=null}">
				<input type="hidden" class="${content.classification.cid}" id="cid">
				</span>
				<input type="hidden" class="${content.tid}" id="tid">
				</span>
				<div class="contentbox">
					<h2 class="contitle">${content.tcontentheader}</h2>
					<p class="bloginfo">
						<span>${content.author}</span><span> <fmt:formatDate
								value="${content.tcreationtime}" pattern="yyyy-MM-dd" />
						</span><span><a href="/">个人博客模板</a></span>
					</p>
					${content.tcontent} <span id="shenmoyaomi"></span>
					<div class="share"></div>
					<div class="nextinfo"></div>
				</div>
			</c:if>
			<div class="pinlun">
				<h2 class="newstitle">
					<b>留言</b>
				</h2>
				<div id="addLeave" style="margin-top: 5px; margin-left: 10px;">
					<form class="layui-form">

						<textarea rows="5" cols="100" name="lcontent" style="margin-top: 20px;margin-left: 20px;"></textarea>
						<button  style="margin-left: 50px;margin-bottom: 60px;" class="layui-btn layui-btn-primary" lay-filter="layuiBtn"
							lay-submit>添加留言</button>
					</form>
				</div>
				<div class="gbok">
					<c:if test="${leaves!=null and leaves.totalPages>0}">
						<div class="zongcomment"></div>
						<c:forEach items="${leaves.data}" var="leave">
							<div class="commentz"
								style="border: 1px solid #ccc; height: 100px;margin-bottom: 10px;padding-top: 10px;padding-left: 10px;padding-right: 10px;">
								留言人:<span class="ip">${leave.iPaddress}</span> <span
									class="shijian" style="float: right;"><fmt:formatDate
										value="${leave.lmessagetime}" pattern="yyyy-MM-dd" /></span> <br />
								<br />留言内容：<span class="neirong">${leave.lcontent}</span>
							</div>
						</c:forEach>
						<div style="padding-left: 300px;padding-top: 50px;">
				总页数:${leaves.totalPages}
						<a href="Leaves?curPage=${leaves.curPage-1 }"style="padding-left: 30px;">上一页</a>
						<c:forEach begin="1" end="${leaves.totalPages }" var="no">
							<a href="Leaves?curPage=${no }" style="padding-left: 30px;">${no }</a>
						</c:forEach>
						<a href="Leaves?curPage=${leaves.curPage+1 }"style="padding-left: 30px;">下一页</a>
						</div>
					</c:if>
				</div>
			</div>
		</div>
		<div class="rside">
			<div class="news">
				<h2 class="newstitle">
					<b>文章排行</b>
				</h2>
				<ul>
					<c:if test="${neirong1!=null}">
						<c:forEach items="${neirong1}" var="tion">
							<li><a href="info/${tion.tid}"><span><fmt:formatDate
											value="${tion.tcreationtime}" pattern="MM-dd" /></span>${tion.tcontentheader}</a></li>
						</c:forEach>
					</c:if>
				</ul>
			</div>
			<div class="news">
				<h2 class="newstitle">
					<b>本栏推荐</b>
				</h2>
				<ul>
					<c:if test="${neirong2!=null}">
						<c:forEach items="${neirong2}" var="tion">
							<li><a href="info/${tion.tid}"><span> <fmt:formatDate
											value="${tion.tcreationtime}" pattern="MM-dd" /></span>
									${tion.tcontentheader}</a></li>
						</c:forEach>
					</c:if>
				</ul>
			</div>
		</div>
		<div class="copyright">
			<p>Copyright 2018 Inc. AllRights Reserved. Design by 杨青个人博客
				蜀ICP备11002373号-1</p>
		</div>
	</div>
	</main>
	<a href="#" class="cd-top cd-is-visible">Top</a>
</body>
<script src="./lib/layui/layui.js"></script>
<script type="text/javascript">
	var page = 1;//当前页
	var limit = 10;//每页显示数
	var content = $("#contentxzs").text();
	$("#shenmoyaomi").html(content);
	layui.use('form', function() {
		var form = layui.form;
		form.on('submit(layuiBtn)', function(data) {
			$.post("addLeave", data.field, function(datas) {
				if (datas == true) {
					alert("添加成功！");
					location.href = "Leaves";
				} else {
					alert("玩不下去了勒");
				}
			}), "json";
			return false;
		})

	})
</script>
</html>